var app = getApp();

Page({
    data: {
        hotel: []
    },
    onLoad: function(o) {
        wx.setNavigationBarColor({
          frontColor: '#000000',
          backgroundColor: '#ffffff'
        });
    },
    search_hotel: function(o) {
        console.log(o);
        var t = this, e = o.detail.value;
        "" != e ? app.util.request({
            url: "entry/wxapp/JdList",
            cachetime: "0",
            data: {
                keywords: e
            },
            success: function(o) {
                console.log(o), t.setData({
                    hotel: o.data
                });
            }
        }) : t.setData({
            hotel: []
        });
    },
    search_result: function(o) {
        var t = o.currentTarget.dataset.id;
        wx.navigateTo({
            url: "../hotel_list/hotel_info?hotel_id=" + t
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {
        this.setData({
            hotel: []
        });
    },
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {}
});